package com.yyplatform.admin.platform.role.model.entity;

import java.io.Serializable;
import java.util.Date;

import org.hibernate.annotations.Proxy;

import com.yyplatform.admin.infra.model.entity.BaseEntity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Created on 2024-09-12
 */
@Setter
@Getter
@Entity
@Table(name = "sys_user")
@Proxy(lazy = false)
@ToString
public class SysUserEntity extends BaseEntity implements Serializable {

    @Column(name = "dept_id", nullable = false, columnDefinition = "bigint(20) comment '部门ID_FK' ")
    private Long deptId;

    @Column(name = "post_id", nullable = false, columnDefinition = " bigint(20) comment '岗位ID_FK' ")
    private Long postId;

    @Column(name = "username", nullable = false, unique = true, columnDefinition = " varchar(50) comment '用户名' ")
    private String username;

    @Column(name = "remark", columnDefinition = " varchar(255) comment '用户备注' ")
    private String remark;

    @Column(name = "real_name", nullable = false, columnDefinition = " varchar(50) comment '用户真实姓名' ")
    private String realName;


    @Column(name = "nickname", nullable = false, columnDefinition = " varchar(50) comment '用户昵称' ")
    private String nickname;

    @Column(name = "email", nullable = false, columnDefinition = " varchar(50) comment '邮箱' ")
    private String email;

    @Column(name = "phone", nullable = false, columnDefinition = " varchar(50) comment '手机号' ")
    private String phone;

    @Column(name = "gender", nullable = false, columnDefinition = " varchar(50) comment '性别' ")
    private String gender;


    @Column(name = "face_url", nullable = false, columnDefinition = " varchar(200) comment '头像URL' ")
    private String faceUrl;


    @Column(name = "password", nullable = false, columnDefinition = " varchar(50) comment '密码' ")
    private String password;

    @Column(name = "salt", nullable = false, columnDefinition = " varchar(50) comment '密码盐' ")
    private String salt;

    @Column(name = "enabled", nullable = false, columnDefinition = " tinyint(1) comment '是否启用' ")
    private Boolean enabled;


    @Column(name = "is_admin", nullable = false, columnDefinition = " tinyint(1) comment '是否是管理员' ")
    private Boolean isAdmin;


    @Column(name = "last_login_time", nullable = false, columnDefinition = " datetime comment '最后登录时间' ")
    private Date lastLoginTime;


    @Column(name = "pwd_reset_time", nullable = false, columnDefinition = " datetime comment '密码重置时间' ")
    private Date pwdResetTime;


}
